using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using SampleApp.Domain;
using SampleApp.Domain.Map;
using System.Data.Entity.Infrastructure;

namespace SampleApp.Data
{
    public partial class SampleDbContext : DbContext
    {
        static SampleDbContext()
        {
            Database.SetInitializer<SampleDbContext>(null);
        }

        public SampleDbContext()
            : base("name=SampleAppDatabase")
        {
            this.Configuration.LazyLoadingEnabled = false;
            this.Configuration.ProxyCreationEnabled = false;
        }


        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<System.Data.Entity.ModelConfiguration.Conventions.PluralizingTableNameConvention>();
            this.RegistEntityMap(modelBuilder.Configurations);
        }
    }
}

